package com.aiguigu.cloud.apis;

import com.aiguigu.cloud.resp.ResultData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;
import com.aiguigu.cloud.entities.ArticleDTO;

/*
 * cloud-article-service服务对外暴露的接口
 * */
@FeignClient(value = "cloud-article-service")
public interface ArticleFeignApi {

    @PostMapping(value = "/article/add")
    public ResultData<String> addArticle(@RequestBody ArticleDTO articleDTO);


    @DeleteMapping(value = "/article/delete/{id}")
    public ResultData<Integer> deleteArticle(@PathVariable("id") Integer id);

    @PutMapping(value = "/article/update")
    public ResultData<String> updateArticle(@RequestBody ArticleDTO articleDTO);

    @GetMapping(value = "/article/get/{id}")
    public ResultData getById(@PathVariable("id") Integer id);

    @GetMapping(value = "/article/get/info")
    public String myLoadBalancer();
}
